home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Singles Flirt Up Your Life! (German)
/
Singles Flirt Up Your Life.iso
/
data1.cab
/
Statemachine
/
questRomance7.lua
< prev
next >
Wrap
Text File
|
2004-01-29
|
3KB
|
90 lines
beginStateMachine()
-- called when questor builds up all known questScripts
onEnter(function(msg)
print("questRomance7 entered");
setState("initial");
end )
-- on game over: relationship conditions get reset to 0 and all quests are reset to initial
onMsg("questreset", function(msg)
setState("initial");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("initial")
onMsg("checkCondition", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ( -- condition here
----------------
min( mike.getRelationshipCondition(ELAINE, REL_ROMANCE),
elaine.getRelationshipCondition(MIKE, REL_ROMANCE) )>=7 )
----------------
then
-- go to talk position
print("questRomance7 - go to waitHug");
setState("waitHug");
end
end )
state("waitHug")
onMsg("queueInteraction", function(msg)
print("questRomance7 - queueInteraction: " .. msg.data);
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
if ((msg.data == "holdNice") or (msg.data == "holdBehind") or (msg.data == "kiss")) then
if (getStateObjectFromID(msg.sender) == mike) then
elaine.queueCommand("pm_talkCutscene", "talkCutscene", mike, "questRomance7");
setState("talktome");
else
mike.queueCommand("pm_talkCutscene", "talkCutscene", elaine, "questRomance7");
setState("talktome");
end
end
end )
state("talktome")
-- as soon as arrived - start dialog (interaction.talkCutscene sends talking)
onMsg("talking", function(msg)
if (msg.data == "questRomance7") then
popupConversation("dialogRomance7");
setState("donetalktome");
end
end )
state("donetalktome")
-- last dialog box clicked away
onMsg("yes", function(msg)
local mike = getParent().getParent().getCharacter(MIKE);
local elaine = getParent().getParent().getCharacter(ELAINE);
mike.cancelCurrentActivity();
elaine.cancelCurrentActivity();
elaine.queueCommand("pm_kissFriendly", "kiss", mike, "Friendly" );
setState("done");
end )
---------------------------------------------------------------------------------------------------------------------------------------
state("done")
-- sackgasse hier
endStateMachine()